package com.sl.biz.modular.process.controller;

import com.sl.biz.modular.process.dao.domain.dto.ProcessCompVersionBuildDTO;
import com.sl.biz.modular.process.dao.domain.entity.ProcessCompVersionBuildDO;
import com.sl.biz.modular.process.service.ProcessCompVersionBuildService;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/process/comp/version/build")
@RequiredArgsConstructor
public class ProcessCompVersionBuildController {

    private final ProcessCompVersionBuildService versionBuildService;


    @PostMapping("/get_last_by_code_and_version")
    public ProcessCompVersionBuildDTO getLastCodeAndVersion(@RequestBody @Validated ProcessCompVersionBuildDO processCompVersionBuildDO) {
        return versionBuildService.getLastCodeAndVersion(processCompVersionBuildDO);
    }
}
